package com.cx.mall.user.service;

import org.springframework.stereotype.Service;

import java.util.List;
@Service
public interface IBaseService <T>{
    /**
     * 保存数据
     * @param entity
     */
    void save(T entity) throws Exception;
    //void save (T entity) throws Exception;
    /**
     * 修改数据
     * @param entity
     */
    void update(T entity) throws Exception;
    //void update (T entity) throws Exception;

    /**
     * 删除数据
     * @param id
     */
    void removeById(Object id) throws Exception;
    //void removeById(Object id) throws Exception;
    /**
     * 按 Id 查询
     * @param id
     */
    T getById(Object id) throws Exception;
    //T getById(Object id) throws Exception;
    /**
     * 按条件查询
     * @param params
     * @return
     */
    T getOne(Object... params) throws Exception;
   // T getOne(Object...params) throws Exception;
    /**
     * 按条件查询
     * @param params
     * @return
     */
    List<T> list(Object... params) throws Exception;
    //List<T> list(Object...params) throws Exception;
}